/* 全局样式和动画 - 暗黑科技主题 */

/* ========== CSS 变量定义 ========== */
:root {
  /* 主色调 - 科技蓝渐变 */
  --primary-start: #00D4FF;
  --primary-end: #0099FF;
  --primary-light: #38BDF8;
  --primary-dark: #0066CC;
  
  /* 辅助色 */
  --secondary-cyan: #00E5FF;
  --secondary-purple: #A78BFA;
  --accent-neon: #00F0FF;
  --accent-green: #10B981;
  
  /* 暗黑背景色 */
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-tertiary: #1F2937;
  --bg-card: #1A1F2E;
  --bg-hover: #252B3B;
  
  /* 文字色 */
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --text-bright: #F9FAFB;
  
  /* 边框色 */
  --border-light: #1F2937;
  --border-normal: #374151;
  --border-bright: #4B5563;
  
  /* 科技感渐变 */
  --gradient-primary: linear-gradient(135deg, #00D4FF 0%, #0099FF 100%);
  --gradient-vibrant: linear-gradient(135deg, #00E5FF 0%, #A78BFA 100%);
  --gradient-neon: linear-gradient(135deg, #00F0FF 0%, #00D4FF 100%);
  --gradient-dark: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Monaco', 
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 
    'Microsoft YaHei', '微软雅黑', monospace, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 5px;
  transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-vibrant);
}

/* ========== Element Plus 自定义样式 ========== */

/* 按钮 */
.el-button--primary {
  background: var(--gradient-primary);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
  transition: all 0.3s;
}

.el-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.el-button--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

/* 输入框 */
.el-input__wrapper {
  transition: all 0.2s;
}

.el-input__wrapper:hover {
  box-shadow: 0 0 0 1px var(--primary-start) inset;
}

.el-input__wrapper.is-focus {
  box-shadow: 0 0 0 2px var(--primary-start) inset !important;
}

/* 选择器 */
.el-select-dropdown__item.selected {
  color: var(--primary-start);
  font-weight: 600;
}

/* 分页 */
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background: var(--gradient-primary);
}

.el-pagination.is-background .el-pager li:not(.disabled):hover {
  color: var(--primary-start);
}

/* 对话框 */
.el-dialog {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.el-dialog__header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f0f1f5;
}

.el-dialog__title {
  font-weight: 700;
  font-size: 18px;
}

.el-dialog__body {
  padding: 24px;
}

/* 消息提示 - 暗黑主题优化 */
.el-message {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  padding: 16px 20px;
  min-width: 320px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.el-message--success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

.el-message--warning {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.95) 0%, rgba(202, 138, 4, 0.95) 100%);
  border-color: rgba(234, 179, 8, 0.3);
  box-shadow: 0 8px 32px rgba(234, 179, 8, 0.4);
}

.el-message--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.el-message--info {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.95) 0%, rgba(0, 153, 255, 0.95) 100%);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
}

.el-message__content {
  font-weight: 700;
  color: #ffffff;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.el-message .el-icon {
  color: #ffffff;
  font-size: 18px;
}

/* 确认框 - 暗黑主题 */
.el-message-box {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
}

.el-message-box__title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-bright);
}

.el-message-box__content {
  color: var(--text-secondary);
}

.el-message-box__header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.el-message-box__btns {
  padding: 16px 24px 24px;
}

.el-message-box__btns .el-button {
  border-radius: 8px;
  font-weight: 600;
}

/* 标签 */
.el-tag {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.el-tag:hover {
  transform: translateY(-1px);
}

/* 加载图标 */
.el-icon.is-loading {
  animation: rotating 2s linear infinite;
}

/* ========== 自定义动画 ========== */

/* 旋转动画 */
@keyframes rotating {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* 滑入动画 */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

/* 缩放动画 */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 渐变背景动画 */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* ========== 工具类 ========== */

/* 渐变文字 */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 渐变背景 */
.gradient-bg {
  background: var(--gradient-primary);
}

/* 玻璃效果 */
.glass-effect {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 阴影效果 */
.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shadow-md {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.shadow-lg {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.shadow-xl {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* 悬停效果 */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* 圆角 */
.rounded-sm {
  border-radius: 6px;
}

.rounded-md {
  border-radius: 8px;
}

.rounded-lg {
  border-radius: 12px;
}

.rounded-xl {
  border-radius: 16px;
}

/* ========== 响应式辅助 ========== */

/* 隐藏滚动条但保持功能 */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* 文本省略 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 过渡效果 ========== */

.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-fast {
  transition: all 0.15s ease-out;
}

.transition-slow {
  transition: all 0.5s ease-out;
}

/* ========== 加载骨架屏 ========== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========== 无障碍 ========== */

/* 跳过主内容链接 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #667eea;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* 焦点样式 */
:focus-visible {
  outline: 2px solid var(--primary-start);
  outline-offset: 2px;
}

/* ========== 打印样式 ========== */

@media print {
  body {
    background: white;
  }
  
  .navbar,
  .btn-back,
  .btn-write,
  .sidebar {
    display: none !important;
  }
  
  .article-container {
    box-shadow: none;
    padding: 0;
  }
}

/* ========== 暗色模式支持 (未来扩展) ========== */

@media (prefers-color-scheme: dark) {
  /* 暗色模式样式可以在这里添加 */
}

/* ========== 移动端优化 ========== */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
}

/* ========== 性能优化 ========== */

/* 启用GPU加速 */
.gpu-accelerate {
  transform: translateZ(0);
  will-change: transform;
}

/* 优化图片渲染 */
img {
  max-width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 选中文本样式 */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-bright);
}

::-moz-selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-bright);
}

